package service.impl;

import java.util.List;

import dao.UsersDao;
import entity.Users;
import service.UsersService;
import util.PageUtil;

public class UsersServiceImpl implements UsersService {
	private UsersDao usersDao;
	@Override
	public Users login(Users users) {
 		return usersDao.findByName(users.getName());
	}
	
	@Override
	public void findPage(PageUtil<Users> page) {
		int count = usersDao.findCount(page);
		page.setTotal(count);
		System.out.println(count);
		List<Users> list = usersDao.findPage(page);
		page.setList(list);
	}
	@Override
	public int updatePwd(Users u) {
		// TODO Auto-generated method stub
		return usersDao.updatePwd(u);
	}
	
	public UsersDao getUsersDao() {
		return usersDao;
	}
	public void setUsersDao(UsersDao usersDao) {
		this.usersDao = usersDao;
	}
	
	
}
